cmake_minimum_required(VERSION 3.5)
project(TrafficStatistics)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

# add SQLite3 C++ wrapper arround sqlite3 library (and sqlite3 itself provided for ease of use)
include_directories(
        common/sand
        common/jsoncpp/json
        common/SQLiteCpp/sqlite3
        common/SQLiteCpp/include
)
add_subdirectory(common/SQLiteCpp)

SET(SQLiteCpp_src
        common/SQLiteCpp/sqlite3/sqlite3.c
        common/SQLiteCpp/src/Backup.cpp
        common/SQLiteCpp/src/Column.cpp
        common/SQLiteCpp/src/Database.cpp
        common/SQLiteCpp/src/Exception.cpp
        common/SQLiteCpp/src/Statement.cpp
        common/SQLiteCpp/src/Transaction.cpp
)

SET(sand_src common/sand/sand.cpp)
SET(jsoncpp_src common/jsoncpp/jsoncpp.cpp)

INCLUDE_DIRECTORIES(
        ./include
        ./
)
LINK_DIRECTORIES(
        /usr/lib/x86_64-linux-gnu/
        /usr/local/lib/
        /usr/lib/
)

set(SOURCE_FILES
        ${sand_src}
        ${jsoncpp_src}
        ${SQLiteCpp_src}
        src/traffic_statistics.cpp
        src/traffic_data_process.cpp)

add_executable(TrafficStatistics ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(TrafficStatistics pthread dl yaml-cpp)
